// 模拟后端动态生成路由
import { MockMethod } from "vite-plugin-mock";


/**
 * roles：页面级别权限，这里模拟二种 "admin"、"common"
 * admin：管理员角色
 * common：普通角色
 */

const permissionRouter = {
  path: "/systemset",
  meta: {
    title: "系统设置",
    icon: "twemoji:gear",
    rank: 10
  },
  children: [
    {
      path: "/labmanage/lablist",
      name: "lablist",
      // component: () => import("@/views/systemset/labmanage/lablist.vue"),
      meta: {
        title: "标签管理",
        roles: ["admin", "common"]
      }
    },
    {
      path: "/rolemanage/rolelist",
      name: "rolelist",
      // component: () => import("@/views/systemset/rolemanage/rolelist.vue"),
      meta: {
        title: "角色管理",
        roles: ["admin", "common"]
      }
    },
    {
      path: "/infomanage/infolist",
      name: "infolist",
      // component: () => import("@/views/systemset/infomanage/infolist.vue"),
      meta: {
        title: "资讯管理",
        roles: ["admin", "common"]
      }
    },
    {
      path: "/infomanage/editaddinfo",
      name: "editaddinfo",
      // component: () => import("@/views/systemset/infomanage/editaddinfo.vue"),
      meta: {
        title: "新增编辑文章",
        showLink: false,
        roles: ["admin", "common"]
      }
    },
    {
      path: "/drugmanage/druglist",
      name: "druglist",
      // component: () => import("@/views/systemset/drugmanage/druglist.vue"),
      meta: {
        title: "药品管理",
        roles: ["admin", "common"]
      }
    },
    {
      path: "/drugmanage/editadddrug",
      name: "editadddrug",
      // component: () => import("@/views/systemset/drugmanage/editadddrug.vue"),
      meta: {
        title: "新增编辑药品",
        showLink: false,
        roles: ["admin", "common"]
      }
    },
    {
      path: "/slidemanage/slidelist",
      name: "slidelist",
      // component: () => import("@/views/systemset/slidemanage/slidelist.vue"),
      meta: {
        title: "轮播图管理",
        roles: ["admin", "common"]
      }
    },
    {
      path: "/slidemanage/editadddrug",
      name: "editadddrug",
      // component: () => import("@/views/systemset/slidemanage/editadddrug.vue"),
      meta: {
        title: "新增编辑轮播图",
        showLink: false,
        roles: ["admin", "common"]
      }
    },
    {
      path: "/agreemanage/agreelist",
      name: "agreelist",
      // component: () => import("@/views/systemset/agreemanage/agreelist.vue"),
      meta: {
        title: "协议管理",
        roles: ["admin", "common"]
      }
    },
    {
      path: "/systemnotice/noticelist",
      name: "noticelist",
      // component: () => import("@/views/systemset/systemnotice/noticelist.vue"),
      meta: {
        title: "系统公告",
        roles: ["admin", "common"]
      }
    },
    {
      path: "/systemnotice/editaddnotice",
      name: "editaddnotice",
      // component: () => import("@/views/systemset/systemnotice/editaddnotice.vue"),
      meta: {
        title: "新增编辑公告",
        roles: ["admin"],
        showLink: false
      }
    },
    {
      path: "/operationlog/loglist",
      name: "loglist",
      // component: () => import("@/views/systemset/operationlog/loglist.vue"),
      meta: {
        title: "操作日志",
        roles: ["admin"]
      }
    }
  ]
  // children: [
  //   {
  //     path: "/permission/page/index",
  //     name: "PermissionPage",
  //     meta: {
  //       title: "页面权限",
  //       roles: ["admin", "common"]
  //     }
  //   },
  //   {
  //     path: "/permission/button/index",
  //     name: "PermissionButton",
  //     meta: {
  //       title: "按钮权限",
  //       roles: ["admin", "common"],
  //       auths: ["btn_add", "btn_edit", "btn_delete"]
  //     }
  //   }
  // ]
};

export default [
  {
    url: "/getAsyncRoutes",
    method: "get",
    response: () => {
      return {
        success: true,
        data: [permissionRouter]
      };
    }
  }
] as MockMethod[];
